﻿using Microsoft.Win32;
using System;
using System.Threading;
using System.Timers;
using Timer = System.Timers.Timer;

namespace _13._1
{
    internal class Program
    {
        static int counter = 0;
        static string displayString = "显示字符串。";

        static void Main(string[] args)
        {
            Timer MyTimer = new Timer(100);
            MyTimer.Elapsed += new ElapsedEventHandler(WriteChar);
            MyTimer.Start();
            Thread.Sleep(1000);
            Console.ReadLine();
        }

        static void WriteChar(object s, ElapsedEventArgs e)
        {
            Console.Write(displayString[counter++ % displayString.Length]);
        }
    }
}
